<template>
  <div>
    <p>以下是子组件的内容</p>
    <button @click="ziEmitsFu">触发emits</button>
    <button @click="getReturn">触发emits</button>
  </div>
</template>

<script setup>

const ziMsg = '我是子组件传递给父组件的值ziMsg'

const emits = defineEmits(['ziEmitsFu', 'getReturn'])

function ziEmitsFu(){
  emits('ziEmitsFu',ziMsg)
}

// emits不能有返回值
const getReturn = () => {
  let a = emits('getReturn')
  debugger
}
</script>